package com.my.bo.impl;

import java.util.List;

import com.my.bean.LiuYan;
import com.my.bean.Pic;
import com.my.bean.User;
import com.my.bo.ManagerBo;

public class ManagerBoImpl extends BaseBo implements ManagerBo {

	/************************************ User ****************************************/
	@Override
	public int checkLogin(User user) {
		if (user.getUserName() == null || user.getPassWord() == null
				|| user.getUserName().equals("")
				|| user.getPassWord().equals("")) {
			return 0;
		}
		return udao.checkLogin(user);
	}

	@Override
	public User checkUser(User user) {
		return udao.checkUser(user);
	}

	/************************************ Pic ****************************************/
	@Override
	public boolean add(Pic pic) throws Exception {
		return picdao.add(pic);
	}

	@Override
	public List<Pic> getAllPic() throws Exception {
		return picdao.getAllPic();
	}

	/************************************ LiuYan ****************************************/
	@Override
	public boolean add(LiuYan liuYan) throws Exception {
		return liuYanDao.add(liuYan);
	}

	@Override
	public List<LiuYan> getAllLiuYan() throws Exception {
		return liuYanDao.getAllLiuYan();
	}

	@Override
	public LiuYan getLiuYanById(Class<LiuYan> liuYan, Integer id)
			throws Exception {
		return liuYanDao.getLiuYanById(liuYan, id);
	}

}
